package smartcounters.androidclient.model;

public class Configuration {
	private static Configuration s_Instance;
	private static Object s_SyncObject = new Object();
	
	private AuthenticatedUserCredentials m_UserCredentials;
	private AuthenticatedUserCredentials m_AdminAuthenticatedCredentials;
	private String m_ServerAddress;
	private UserInfo m_LoggedInUser;
	
	private Configuration(){
		m_AdminAuthenticatedCredentials = new AuthenticatedUserCredentials(1, "12345678");
	}
	
	public static Configuration getInstance(){
		if (s_Instance == null){
			synchronized (s_SyncObject) {
				if (s_Instance == null){
					s_Instance = new Configuration();
				}
			}
		}
		
		return s_Instance;
	}
	
	public AuthenticatedUserCredentials getUserCredentials(){
		return m_UserCredentials;
	}
	
	public void setUserCredentials(AuthenticatedUserCredentials i_AuthenticatedUserCredentials){
		m_UserCredentials = i_AuthenticatedUserCredentials;
	}
	
	public String getServerAddress(){
		return m_ServerAddress;
	}
	
	public void setServerAddress(String i_ServerAddress){
		m_ServerAddress = i_ServerAddress;
	}
	
	public UserInfo getLoggedInUser(){
		return m_LoggedInUser;
	}
	
	public void setLoggedInUser(UserInfo i_UserInfo){
		m_LoggedInUser = i_UserInfo;
	}
	
	public AuthenticatedUserCredentials getAdminAuthenticatedCredentials(){
		return m_AdminAuthenticatedCredentials;
	}
}
